<!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link rel="icon" type="image/svg+xml" href="assets/logo.svg"/>
    <!--    <link rel="stylesheet" href="index.css">-->
    <link rel="stylesheet" href="https://static.goupapp.com/web/homepage/index.css">
    <title>GOUP—畅享游戏开黑乐趣的社区语音软件</title>
    <meta name="baidu-site-verification" content="codeva-UamzoczYBO"/>
    <meta name="keywords" content="GOUP，goup，Goup，游戏开黑，游戏社区，游戏语音，语音软件，游戏语音软件，开黑软件，开黑">
    <meta name="description" content="GOUP游戏社区，专为热爱游戏的你打造，我们致力于提供一站式游戏开黑，社区交流，语音视频通讯服务，让你可以实现实时的游戏语音交流，清晰无延迟，我们采用先进的音视频处理技术，确保音质，画质清晰，让你在游戏中的每一个指令都被准确传达，GOUP社区还提供丰富的社区功能，你可以在这边发布游戏新的，分享游戏技巧，还能参加各种社区活动，赢取丰厚的奖励，我们的目标是打造一个集游戏开黑，社区交流，语音通讯于一体的综合性游戏开黑服务平台">
    <script src="https://static.goupapp.com/web/homepage/js/jquery.js"></script>
    <script src="https://static.goupapp.com/web/homepage/js/utils.js"></script>
</head>
<body>
<div class="goup-homepage" style="display: none;">
    <div class="goup-home-item disSelected">
        <img alt="" class="item-background item-background1" src="https://static.goupapp.com/web/homepage/assets/bg1.png">
        <div class="item-wrapper">
            <div class="top-wrapper">
                <img src="https://static.ntzq.tech/web/homepage/assets/svg/goup_icon.svg" alt="" class="goup-icon"/>
                <div class="menu-wrapper">
                   <span class="menu-item menu-item-active">
                       首页
                       <label class="active-line"></label>
                   </span>
                    <span class="menu-item menu-item-news">资讯</span>
                </div>
                <div class="top-right-wrapper">
                   <span class="download-text">
                       <img src="https://static.ntzq.tech/web/homepage/assets/svg/download1.svg" alt="" class="download-icon"/>
                       下载客户端
                   </span>
                    <span class="web-text">
                       进入网页版
                   </span>
                </div>
            </div>

            <div class="center-wrapper">
                <img src="https://static.ntzq.tech/web/homepage/assets/svg/homepage_title1.svg" alt="" class="center-top-title"/>
                <span class="tips">
                 语  音  交  流  心  得  屏  幕  共  享  快  乐
               </span>
                <div class="operation-wrapper">
                    <span class="download-button">Windows版下载</span>
                    <span class="web-button">
                      进入Web版
                      <img src="https://static.ntzq.tech/web/homepage/assets/svg/to_web.svg" alt="" class="web-icon"/>
                    </span>
                </div>
            </div>
        </div>
    </div>

    <div class="goup-home-item">
        <img alt="" class="item-background" src="https://static.goupapp.com/web/homepage/assets/bg2.webp">
        <div class="item-wrapper">
            <img alt="" class="screen-short" src="https://static.goupapp.com/web/homepage/assets/app_screenshort1.webp">
        </div>
    </div>

    <div class="goup-home-item">
        <img alt="" class="item-background" src="https://static.goupapp.com/web/homepage/assets/bg2.webp">
        <div class="item-wrapper">
            <img alt="" class="screen-short" src="https://static.goupapp.com/web/homepage/assets/app_screenshort2.webp">
        </div>
    </div>

    <div class="goup-home-item">
        <img alt="" class="item-background" src="https://static.goupapp.com/web/homepage/assets/bg2.webp">
        <div class="item-wrapper">
            <img alt="" class="screen-short" src="https://static.goupapp.com/web/homepage/assets/app_screenshort3.webp">
        </div>
    </div>

    <div class="goup-homepage-bottom">
        <img src="https://static.ntzq.tech/web/homepage/assets/svg/homepage_title2.svg" alt="" class="bottom-title"/>
        <span class="download-button">
             <img src="https://static.ntzq.tech/web/homepage/assets/svg/download2.svg" alt="" class="download-icon"/>
              下载PC客户端
           </span>
        <div class="news-list-container">
            @foreach ($news as $new)
            <div class="" data-id="{{ $new->id }}" data-url="{{ $new->id }}">
                <img alt="" class="item-cover" src="{{ $new->cover }}">
                <div class="item-details">
                    <div class="item-title">
                           <span class="item-title-text">
                               {{ $new->title }}
                           </span>
                        <span class="item-title-time">
                              {{ $new->created_at }}
                           </span>
                    </div>
                    <div class="item-subtitle">
                        {{ $new->summary }}
                    </div>
                    <div class="read-count">
                            <span class="news-read-count">
                               <img alt="" src="https://static.ntzq.tech/web/homepage/assets/svg/eye.svg" class="eye-icon">
                              9999
                           </span>
                    </div>
                </div>
            </div>
            @endforeach
        </div>
        <div class="more-container">
               <span class="more-text">
                 更多资讯
                   <img alt="" src="https://static.ntzq.tech/web/homepage/assets/svg/more.svg" class="more-icon">
               </span>
        </div>
        <div class="agreement-wrapper">
            <div class="agreement-top">
                <a class="item item1">
                    用户协议
                </a>
                <a class="item item2">
                    隐私政策
                </a>
                <a class="item" href="https://static.goupapp.com/web/homepage/zhizhao.pdf" target="_blank">
                    营业执照
                </a>
            </div>
            <div class="agreement-bottom">
                <div class="row">
                    <a>公司名称:南通卓趣科技有限公司</a>
                    <a>公司地址:江苏省南通市崇川区深南路199号天安数码城8幢301室）</a>
                    <!--                    <a>联系方式:18851317265</a>-->
                </div>
                <div class="row">
                    <a href="https://tsm.miit.gov.cn/dxxzsp/xkz/xkzgl/resource/qiyesearch.jsp?num=苏B2-20231522&type=xuke" target="_blank">增值电信业务经营许可证:苏B2-20231522</a>
                    <a href="https://beian.miit.gov.cn/" target="_blank">互联网ICP备案:苏ICP备2023020806号-2</a>
                    <img alt="" class="beian-icon" src="https://static.goupapp.com/web/homepage/assets/beian.png">
                    <a href="https://beian.mps.gov.cn/#/query/webSearch?code=32060202001938" rel="noreferrer" target="_blank">
                        苏公网安备32060202001938号
                    </a>

                </div>
                <img alt="" class="goup-icon" src="https://static.goupapp.com/web/homepage/assets/icon.webp">
            </div>
        </div>
    </div>
</div>

<script>
    $(document).ready(function () {
        $('.item-background1').on('load', function () {
            // 图片加载完成后显示 goup-homepage
            $('.goup-homepage').show();
        });

        // 如果图片已经加载完成（可能会缓存）
        if ($('.item-background1')[0].complete) {
            $('.goup-homepage').show();
        }
        let version = {};
        let agreementList = {};
        const path = getRequsetPath();
        const getLatestVersion = async () => {
            $.ajax({
                url: path + '/api/home/app_latest_version',
                type: 'POST',
                dataType: 'json',
                success: function (response) {
                    version = response.data.latest_version;
                },
                error: function (xhr, status, error) {
                    console.log('请求失败:', error);
                },
            });
        };

        const goDiscover = () => {
            const env = getEnv();
            const redirectUrl = env === "production" ? "https://web.goupapp.com/app/" : "https://web.ntzq.tech/app/";
            window.location.href = redirectUrl + "login";
        };

        const downloadApp = () => {
            if (!version.version) return;
            const staticUrl = getStaticUrl();
            window.open(staticUrl + `/app/Goup_Setup_v${version.version}.exe`);
        };

        const showAgreement = async (type) => {
            if (!agreementList[type]) {
                $.ajax({
                    url: path + '/api/home/agreement_list',
                    type: 'POST',
                    dataType: 'json',
                    success: function (response) {
                        console.log('请求成功:', response);
                        agreementList = response.data;
                        debugger
                        window.open(agreementList[type]);
                    },
                    error: function (xhr, status, error) {
                        console.log('请求失败:', error);
                    },
                });
            }
            window.open(agreementList[type]);
        };

        $("img.item-background").on("load", function () {
            $("#goup-homepage").show();
        });

        $(".download-text").click(downloadApp);
        $(".web-text").click(goDiscover);
        $(".download-button").click(downloadApp);
        $(".web-button").click(goDiscover);
        $(".agreement-top .item1").click(function () {
            showAgreement('user_agreement');
        });
        $(".agreement-top .item2").click(function () {
            showAgreement('privacy_policy');
        });
        getLatestVersion();

        $(".menu-item-news").click(function () {
            window.location.href = "/new_list";
        });
        $(".more-text").click(function () {
            window.location.href = "/new_list";
        });

        $('.news-item').on('click', function () {
            const id = $(this).data('id');
            const url = $(this).data('url');
            window.open(url);
            $.ajax({
                url: path + '/api/news/news_count',
                type: 'POST',
                data: {
                    id: id
                },
                dataType: 'json',
                success: function (response) {
                },
                error: function (xhr, status, error) {
                    console.log('请求失败:', error);
                },
            });
        });

        // let page = {
        //     page: 1,
        //     size: 10
        // }
        // const getNewsList = () => {
        //     $.ajax({
        //         url: path + '/api/news/news_list',
        //         type: 'POST',
        //         data: {
        //             page: page.page,
        //             size: page.size
        //         },
        //         dataType: 'json',
        //         success: function (response) {
        //             page = response.data;
        //             updateNewsList();
        //         },
        //         error: function (xhr, status, error) {
        //             console.log('请求失败:', error);
        //         },
        //     });
        // }
        // const updateNewsList = () => {
        //     const newsListContainer = $('.news-list-container');
        //     let newsItemHtml = "";
        //     newsListContainer.empty();
        //     page.content.forEach(item => {
        //         newsItemHtml = `
        //         <div class="news-item" data-id="${item.id}">
        //             <img alt="" class="item-cover" src="${item.cover}">
        //             <div class="item-details">
        //                 <div class="item-title">
        //                     <span class="item-title-text">
        //                         ${item.title}
        //                     </span>
        //                     <span class="item-title-time">
        //                         ${item.created_at}
        //                     </span>
        //                 </div>
        //                 <div class="item-subtitle">
        //                     ${item.summary}
        //                 </div>
        //                 <div class="read-count">
        //                      <span class="news-read-count">
        //                         <img alt="" src="../../assets/svg/eye.svg" class="eye-icon">
        //                        ${item.count}
        //                     </span>
        //                 </div>
        //             </div>
        //         </div>
        //     `;
        //         newsListContainer.append(newsItemHtml);
        //     })
        // };
        // getNewsList();
    });
</script>
</body>
</html>
